package com.xbzl.cly_demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

//import lombok.Builder;
//import lombok.Data;

/**
 * 车辆状态表，存储随时间变化的数据
 * @TableName vehicle_status
 */
//@Builder
@TableName(value ="vehicle_status")
//@Data
public class VehicleStatus implements Serializable {
    /**
     * 车辆状态ID（主键）
     */
    @TableId(value = "vehicle_status_id", type = IdType.AUTO)
    private Long vehicleStatusId;

    /**
     * 车辆Vin（外键关联 Vehicle 表）
     */
    @TableField(value = "vehicle_vin")
    private String vehicleVin;

    /**
     * GNSS 时间戳
     */
    @TableField(value = "timestamp_gnss")
    private Long timestampGnss;

    /**
     * GNSS 速度（m/s）
     */
    @TableField(value = "velocity_gnss")
    private Double velocityGnss;

    /**
     * 经度
     */
    @TableField(value = "longitude")
    private BigDecimal longitude;

    /**
     * 纬度
     */
    @TableField(value = "latitude")
    private BigDecimal latitude;

    /**
     * 航向角度（度）
     */
    @TableField(value = "heading")
    private Double heading;

    /**
     * 纵向加速度（m/s²）
     */
    @TableField(value = "acceleration_lon")
    private Double accelerationLon;

    /**
     * 横向加速度（m/s²）
     */
    @TableField(value = "acceleration_lat")
    private Double accelerationLat;

    /**
     * 偏航率（角速度）
     */
    @TableField(value = "yaw_rate")
    private Integer yawRate;

    /**
     * 加速踏板位置
     */
    @TableField(value = "accel_pos")
    private Integer accelPos;

    /**
     * 发动机转速（rpm）
     */
    @TableField(value = "engine_speed")
    private Integer engineSpeed;

    /**
     * 发动机扭矩
     */
    @TableField(value = "engine_torque")
    private Integer engineTorque;

    /**
     * 制动状态（1=激活，0=未激活）
     */
    @TableField(value = "brake_flag")
    private Integer brakeFlag;

    /**
     * 制动踏板位置
     */
    @TableField(value = "brake_pos")
    private Integer brakePos;

    /**
     * 制动压力（Pa）
     */
    @TableField(value = "brake_pressure")
    private Integer brakePressure;

    /**
     * 油耗
     */
    @TableField(value = "fuel_consumption")
    private Integer fuelConsumption;

    /**
     * 记录创建时间
     */
    @TableField(value = "created_at")
    private LocalDateTime createdAt;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public Long getVehicleStatusId() {
        return vehicleStatusId;
    }

    public void setVehicleStatusId(Long vehicleStatusId) {
        this.vehicleStatusId = vehicleStatusId;
    }

    public String getVehicleVin() {
        return vehicleVin;
    }

    public void setVehicleVin(String vehicleVin) {
        this.vehicleVin = vehicleVin;
    }

    public Long getTimestampGnss() {
        return timestampGnss;
    }

    public void setTimestampGnss(Long timestampGnss) {
        this.timestampGnss = timestampGnss;
    }

    public Double getVelocityGnss() {
        return velocityGnss;
    }

    public void setVelocityGnss(Double velocityGnss) {
        this.velocityGnss = velocityGnss;
    }

    public BigDecimal getLongitude() {
        return longitude;
    }

    public void setLongitude(BigDecimal longitude) {
        this.longitude = longitude;
    }

    public BigDecimal getLatitude() {
        return latitude;
    }

    public void setLatitude(BigDecimal latitude) {
        this.latitude = latitude;
    }

    public Double getHeading() {
        return heading;
    }

    public void setHeading(Double heading) {
        this.heading = heading;
    }

    public Double getAccelerationLon() {
        return accelerationLon;
    }

    public void setAccelerationLon(Double accelerationLon) {
        this.accelerationLon = accelerationLon;
    }

    public Double getAccelerationLat() {
        return accelerationLat;
    }

    public void setAccelerationLat(Double accelerationLat) {
        this.accelerationLat = accelerationLat;
    }

    public Integer getYawRate() {
        return yawRate;
    }

    public void setYawRate(Integer yawRate) {
        this.yawRate = yawRate;
    }

    public Integer getAccelPos() {
        return accelPos;
    }

    public void setAccelPos(Integer accelPos) {
        this.accelPos = accelPos;
    }

    public Integer getEngineSpeed() {
        return engineSpeed;
    }

    public void setEngineSpeed(Integer engineSpeed) {
        this.engineSpeed = engineSpeed;
    }

    public Integer getEngineTorque() {
        return engineTorque;
    }

    public void setEngineTorque(Integer engineTorque) {
        this.engineTorque = engineTorque;
    }

    public Integer getBrakeFlag() {
        return brakeFlag;
    }

    public void setBrakeFlag(Integer brakeFlag) {
        this.brakeFlag = brakeFlag;
    }

    public Integer getBrakePos() {
        return brakePos;
    }

    public void setBrakePos(Integer brakePos) {
        this.brakePos = brakePos;
    }

    public Integer getBrakePressure() {
        return brakePressure;
    }

    public void setBrakePressure(Integer brakePressure) {
        this.brakePressure = brakePressure;
    }

    public Integer getFuelConsumption() {
        return fuelConsumption;
    }

    public void setFuelConsumption(Integer fuelConsumption) {
        this.fuelConsumption = fuelConsumption;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        VehicleStatus other = (VehicleStatus) that;
        return (this.getVehicleStatusId() == null ? other.getVehicleStatusId() == null : this.getVehicleStatusId().equals(other.getVehicleStatusId()))
                && (this.getVehicleVin() == null ? other.getVehicleVin() == null : this.getVehicleVin().equals(other.getVehicleVin()))
                && (this.getTimestampGnss() == null ? other.getTimestampGnss() == null : this.getTimestampGnss().equals(other.getTimestampGnss()))
                && (this.getVelocityGnss() == null ? other.getVelocityGnss() == null : this.getVelocityGnss().equals(other.getVelocityGnss()))
                && (this.getLongitude() == null ? other.getLongitude() == null : this.getLongitude().equals(other.getLongitude()))
                && (this.getLatitude() == null ? other.getLatitude() == null : this.getLatitude().equals(other.getLatitude()))
                && (this.getHeading() == null ? other.getHeading() == null : this.getHeading().equals(other.getHeading()))
                && (this.getAccelerationLon() == null ? other.getAccelerationLon() == null : this.getAccelerationLon().equals(other.getAccelerationLon()))
                && (this.getAccelerationLat() == null ? other.getAccelerationLat() == null : this.getAccelerationLat().equals(other.getAccelerationLat()))
                && (this.getYawRate() == null ? other.getYawRate() == null : this.getYawRate().equals(other.getYawRate()))
                && (this.getAccelPos() == null ? other.getAccelPos() == null : this.getAccelPos().equals(other.getAccelPos()))
                && (this.getEngineSpeed() == null ? other.getEngineSpeed() == null : this.getEngineSpeed().equals(other.getEngineSpeed()))
                && (this.getEngineTorque() == null ? other.getEngineTorque() == null : this.getEngineTorque().equals(other.getEngineTorque()))
                && (this.getBrakeFlag() == null ? other.getBrakeFlag() == null : this.getBrakeFlag().equals(other.getBrakeFlag()))
                && (this.getBrakePos() == null ? other.getBrakePos() == null : this.getBrakePos().equals(other.getBrakePos()))
                && (this.getBrakePressure() == null ? other.getBrakePressure() == null : this.getBrakePressure().equals(other.getBrakePressure()))
                && (this.getFuelConsumption() == null ? other.getFuelConsumption() == null : this.getFuelConsumption().equals(other.getFuelConsumption()))
                && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getVehicleStatusId() == null) ? 0 : getVehicleStatusId().hashCode());
        result = prime * result + ((getVehicleVin() == null) ? 0 : getVehicleVin().hashCode());
        result = prime * result + ((getTimestampGnss() == null) ? 0 : getTimestampGnss().hashCode());
        result = prime * result + ((getVelocityGnss() == null) ? 0 : getVelocityGnss().hashCode());
        result = prime * result + ((getLongitude() == null) ? 0 : getLongitude().hashCode());
        result = prime * result + ((getLatitude() == null) ? 0 : getLatitude().hashCode());
        result = prime * result + ((getHeading() == null) ? 0 : getHeading().hashCode());
        result = prime * result + ((getAccelerationLon() == null) ? 0 : getAccelerationLon().hashCode());
        result = prime * result + ((getAccelerationLat() == null) ? 0 : getAccelerationLat().hashCode());
        result = prime * result + ((getYawRate() == null) ? 0 : getYawRate().hashCode());
        result = prime * result + ((getAccelPos() == null) ? 0 : getAccelPos().hashCode());
        result = prime * result + ((getEngineSpeed() == null) ? 0 : getEngineSpeed().hashCode());
        result = prime * result + ((getEngineTorque() == null) ? 0 : getEngineTorque().hashCode());
        result = prime * result + ((getBrakeFlag() == null) ? 0 : getBrakeFlag().hashCode());
        result = prime * result + ((getBrakePos() == null) ? 0 : getBrakePos().hashCode());
        result = prime * result + ((getBrakePressure() == null) ? 0 : getBrakePressure().hashCode());
        result = prime * result + ((getFuelConsumption() == null) ? 0 : getFuelConsumption().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", vehicleStatusId=").append(vehicleStatusId);
        sb.append(", vehicleVin=").append(vehicleVin);
        sb.append(", timestampGnss=").append(timestampGnss);
        sb.append(", velocityGnss=").append(velocityGnss);
        sb.append(", longitude=").append(longitude);
        sb.append(", latitude=").append(latitude);
        sb.append(", heading=").append(heading);
        sb.append(", accelerationLon=").append(accelerationLon);
        sb.append(", accelerationLat=").append(accelerationLat);
        sb.append(", yawRate=").append(yawRate);
        sb.append(", accelPos=").append(accelPos);
        sb.append(", engineSpeed=").append(engineSpeed);
        sb.append(", engineTorque=").append(engineTorque);
        sb.append(", brakeFlag=").append(brakeFlag);
        sb.append(", brakePos=").append(brakePos);
        sb.append(", brakePressure=").append(brakePressure);
        sb.append(", fuelConsumption=").append(fuelConsumption);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }

    public static class Builder {
        private final VehicleStatus instance;

        public Builder() {
            instance = new VehicleStatus();
        }

        public Builder vehicleStatusId(Long vehicleStatusId) {
            instance.setVehicleStatusId(vehicleStatusId);
            return this;
        }

        public Builder vehicleVin(String vehicleVin) {
            instance.setVehicleVin(vehicleVin);
            return this;
        }

        public Builder timestampGnss(Long timestampGnss) {
            instance.setTimestampGnss(timestampGnss);
            return this;
        }

        public Builder velocityGnss(Double velocityGnss) {
            instance.setVelocityGnss(velocityGnss);
            return this;
        }

        public Builder longitude(BigDecimal longitude) {
            instance.setLongitude(longitude);
            return this;
        }

        public Builder latitude(BigDecimal latitude) {
            instance.setLatitude(latitude);
            return this;
        }

        public Builder heading(Double heading) {
            instance.setHeading(heading);
            return this;
        }

        public Builder accelerationLon(Double accelerationLon) {
            instance.setAccelerationLon(accelerationLon);
            return this;
        }

        public Builder accelerationLat(Double accelerationLat) {
            instance.setAccelerationLat(accelerationLat);
            return this;
        }

        public Builder yawRate(Integer yawRate) {
            instance.setYawRate(yawRate);
            return this;
        }

        public Builder accelPos(Integer accelPos) {
            instance.setAccelPos(accelPos);
            return this;
        }

        public Builder engineSpeed(Integer engineSpeed) {
            instance.setEngineSpeed(engineSpeed);
            return this;
        }

        public Builder engineTorque(Integer engineTorque) {
            instance.setEngineTorque(engineTorque);
            return this;
        }

        public Builder brakeFlag(Integer brakeFlag) {
            instance.setBrakeFlag(brakeFlag);
            return this;
        }

        public Builder brakePos(Integer brakePos) {
            instance.setBrakePos(brakePos);
            return this;
        }

        public Builder brakePressure(Integer brakePressure) {
            instance.setBrakePressure(brakePressure);
            return this;
        }

        public Builder fuelConsumption(Integer fuelConsumption) {
            instance.setFuelConsumption(fuelConsumption);
            return this;
        }

        public Builder createdAt(LocalDateTime createdAt) {
            instance.setCreatedAt(createdAt);
            return this;
        }

        public VehicleStatus build() {
            return instance;
        }
    }


    public static Builder builder() {
        return new Builder();
    }



}